class BoardTypesController < ApplicationController
  # GET /board_types
  # GET /board_types.json
  def index
    @board_types = BoardType.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @board_types }
    end
  end

  # GET /board_types/new
  # GET /board_types/new.json
  def new
    @board_type = BoardType.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @board_type }
    end
  end

  # POST /board_types
  # POST /board_types.json
  def create
    @board_type = BoardType.new(params[:board_type])

    respond_to do |format|
      if @board_type.save
        format.html { redirect_to board_types_path, notice: 'Board type was successfully created.' }
        format.json { render json: @board_type, status: :created, location: @board_type }
      else
        format.html { render action: "new" }
        format.json { render json: @board_type.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /board_types/1
  # DELETE /board_types/1.json
  def destroy
    @board_type = BoardType.find(params[:id])
    @board_type.destroy

    respond_to do |format|
      format.html { redirect_to board_types_url }
      format.json { head :no_content }
    end
  end
end
